/*
 * @Descripttion:
 * @version:
 * @Date: 2021-04-20 11:06:21
 * @LastEditors: huzhushan@126.com
 * @LastEditTime: 2021-04-21 09:36:55
 * @Author: huzhushan@126.com
 * @HomePage: https://huzhushan.gitee.io/vue3-element-admin
 * @Github: https://github.com/huzhushan/vue3-element-admin
 * @Donate: https://huzhushan.gitee.io/vue3-element-admin/donate/
 */
import request from '@/utils/request'

//    查询所有的DeptParentId=0数据
export const deptByParentId = data => {
  return request({
    url: '/service-product/tDept/deptByParentId',
    method: 'get',
    params: data,
  })
}
export const deptChildrenById = parentId => {
  return request({
    url: '/service-product/tDept/deptChildrenById',
    method: 'get',
    params: { parentId: parentId },
  })
}
// 根据id查询dept信息
export const deptById = id => {
  return request({
    url: '/service-product/tDept/deptById',
    method: 'get',
    params: { id: id },
  })
}
// 根据id修改数据
export const deptUpdate = dept => {
  return request({
    url: '/service-product/tDept/deptUpdate',
    method: 'post',
    params: dept,
  })
}
// 根据id删除数据
export const deptDeleteByDeptId = dept => {
  return request({
    url: '/service-product/tDept/deptDelete',
    method: 'post',
    params: dept,
  })
}
// 删除部门一级部门下的所有部门
export const deptDelAll = dept => {
  return request({
    url: '/service-product/tDept/deptDelAll',
    method: 'post',
    params: dept,
  })
}
// 添加dept信息
export const deptSave = dept => {
  return request({
    url: '/service-product/tDept/deptSave',
    method: 'post',
    params: dept,
  })
}
// 根据租户id和二级部门进行查询
export const deptByTenantId = tenantId => {
  return request({
    url: '/service-product/tDept/deptByTenantId',
    method: 'get',
    params: { tenantId: tenantId },
  })
}
